package com.hello.booksale.entity;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Component;

import java.util.Collection;
import java.util.Collections;

@Component
@Data
public class AdminEntity extends UserEntity{
    public AdminEntity() {
        super.setUserName("admin");
        super.setUserPassword("{noop}123456");
    }
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return Collections.singletonList(new RoleEntity("ROLE_admin"));
    }

}
